package com.system.controller;

import com.system.po.AccidentType;
import com.system.service.AccidentService;
import com.system.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RequestMapping("/accident")
@Controller
@Api(value = "/accident", tags = "accident接口")
public class AccidentController {

    @Autowired
    private AccidentService accidentServiceImpl;


    @RequestMapping(value = "/list",method = RequestMethod.GET)
    @ApiOperation("accidentList集合")
    @ResponseBody
    public Result selectAccidentList(){
      List<AccidentType> list=  accidentServiceImpl.selectAccidentList();
      return list.size()>0?Result.ok(list):Result.fail("查询失败") ;

    }



    }
